/**
 * @file    dev_pcf85163.h
 * @brief   外部设备驱动-RTC驱动
 * @author  Liuwei
 * @version 1.0.1
 * @date    2024-03-28
 * 
 * @copyright Copyright (c) 2023 JBD-Energy Storage Technology Co. LTD
 * 
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version   <th>Author   <th>Description
 * <tr><td>2023-04-22 <td>1.0.1     <td>Liuwei   <td>首次创建
 * </table>
 */

#ifndef __DEV_PCF85163_H_
#define __DEV_PCF85163_H_

/* file includes -------------------------------------------------------------*/
#include "mcu_type.h"
/* cplusplus -----------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif

/* macro/define/typedef ------------------------------------------------------*/
#include "drv_rtc.h"
/* @brief */
#define PCF85163_CTL1         (0x00)
#define PCF85163_CTL2         (0x01)

#define PCF85163_REG_SEC      (0x02)
#define PCF85163_REG_MIN      (0x03)
#define PCF85163_REG_HOUR     (0x04)
#define PCF85163_REG_DAY      (0x05)
#define PCF85163_REG_WEEK     (0x06)
#define PCF85163_REG_MONTH    (0x07)
#define PCF85163_REG_YEAR     (0x08)

#define PCF85163_REG_MIN_ALM  (0x09)
#define PCF85163_REG_HOUR_ALM (0x0A)
#define PCF85163_REG_DAY_ALM  (0x0B)
#define PCF85163_REG_WEEK_ALM (0x0C)

#define PCF85163_CLKOUT_CTL   (0x0D)
#define PCF85163_TIME_CTL     (0x0E)
#define PCF85163_TIMER        (0x0F)

//#endif 
/* variables -----------------------------------------------------------------*/

/*******************************************************************************
 * public API List
 ******************************************************************************/
uint8_t dev_pcf85163_init(rtc_data_type rtc_init);
uint8_t dev_pcf85163_read_date_time(rtc_data_type *rtc_data);
uint8_t dev_pcf85163_set_date_time(rtc_data_type set_val);
uint8_t dev_pcf85163_read_status(uint8_t *status);

#ifdef __cplusplus
}
#endif

#endif  /* #ifndef __DEV_PCF85163_H_ */
/********** Copyright (c) 2023 JBD-Energy Storage Technology Co. LTD *********/
